home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / clib / dos_protos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-28  |  10.4 KB  |  245 lines

  1. #ifndef  CLIB_DOS_PROTOS_H
  2. #define  CLIB_DOS_PROTOS_H
  3.  
  4. /*
  5. **    $VER: dos_protos.h 40.2 (6.6.1998)
  6. **
  7. **    C prototypes. For use with 32 bit integers only.
  8. **
  9. **    Copyright © 1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif /* __cplusplus */
  16.  
  17. #ifndef  DOS_DOS_H
  18. #include <dos/dos.h>
  19. #endif
  20. #ifndef  DOS_DOSEXTENS_H
  21. #include <dos/dosextens.h>
  22. #endif
  23. #ifndef  DOS_RECORD_H
  24. #include <dos/record.h>
  25. #endif
  26. #ifndef  DOS_RDARGS_H
  27. #include <dos/rdargs.h>
  28. #endif
  29. #ifndef  DOS_DOSASL_H
  30. #include <dos/dosasl.h>
  31. #endif
  32. #ifndef  DOS_VAR_H
  33. #include <dos/var.h>
  34. #endif
  35. #ifndef  DOS_NOTIFY_H
  36. #include <dos/notify.h>
  37. #endif
  38. #ifndef  DOS_DATETIME_H
  39. #include <dos/datetime.h>
  40. #endif
  41. #ifndef  DOS_EXALL_H
  42. #include <dos/exall.h>
  43. #endif
  44. #ifndef  UTILITY_TAGITEM_H
  45. #include <utility/tagitem.h>
  46. #endif
  47. BPTR Open( CONST_STRPTR name, LONG accessMode );
  48. LONG Close( BPTR file );
  49. LONG Read( BPTR file, APTR buffer, LONG length );
  50. LONG Write( BPTR file, CONST APTR buffer, LONG length );
  51. BPTR Input( VOID );
  52. BPTR Output( VOID );
  53. LONG Seek( BPTR file, LONG position, LONG offset );
  54. LONG DeleteFile( CONST_STRPTR name );
  55. LONG Rename( CONST_STRPTR oldName, CONST_STRPTR newName );
  56. BPTR Lock( CONST_STRPTR name, LONG type );
  57. VOID UnLock( BPTR lock );
  58. BPTR DupLock( BPTR lock );
  59. LONG Examine( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  60. LONG ExNext( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  61. LONG Info( BPTR lock, struct InfoData *parameterBlock );
  62. BPTR CreateDir( CONST_STRPTR name );
  63. BPTR CurrentDir( BPTR lock );
  64. LONG IoErr( VOID );
  65. struct MsgPort *CreateProc( CONST_STRPTR name, LONG pri, BPTR segList, LONG stackSize );
  66. VOID Exit( LONG returnCode );
  67. BPTR LoadSeg( CONST_STRPTR name );
  68. VOID UnLoadSeg( BPTR seglist );
  69. struct MsgPort *DeviceProc( CONST_STRPTR name );
  70. LONG SetComment( CONST_STRPTR name, CONST_STRPTR comment );
  71. LONG SetProtection( CONST_STRPTR name, LONG protect );
  72. struct DateStamp *DateStamp( struct DateStamp *date );
  73. VOID Delay( LONG timeout );
  74. LONG WaitForChar( BPTR file, LONG timeout );
  75. BPTR ParentDir( BPTR lock );
  76. LONG IsInteractive( BPTR file );
  77. LONG Execute( CONST_STRPTR string, BPTR file, BPTR file2 );
  78. /*--- functions in V36 or higher (Release 2.0) ---*/
  79. /*    DOS Object creation/deletion */
  80. APTR AllocDosObject( ULONG type, CONST struct TagItem *tags );
  81. APTR AllocDosObjectTagList( ULONG type, CONST struct TagItem *tags );
  82. APTR AllocDosObjectTags( ULONG type, ULONG tag1type, ... );
  83. VOID FreeDosObject( ULONG type, APTR ptr );
  84. /*    Packet Level routines */
  85. LONG DoPkt( struct MsgPort *port, LONG action, LONG arg1, LONG arg2, LONG arg3, LONG arg4, LONG arg5 );
  86. LONG DoPkt0( struct MsgPort *port, LONG action );
  87. LONG DoPkt1( struct MsgPort *port, LONG action, LONG arg1 );
  88. LONG DoPkt2( struct MsgPort *port, LONG action, LONG arg1, LONG arg2 );
  89. LONG DoPkt3( struct MsgPort *port, LONG action, LONG arg1, LONG arg2, LONG arg3 );
  90. LONG DoPkt4( struct MsgPort *port, LONG action, LONG arg1, LONG arg2, LONG arg3, LONG arg4 );
  91. VOID SendPkt( struct DosPacket *dp, struct MsgPort *port, struct MsgPort *replyport );
  92. struct DosPacket *WaitPkt( VOID );
  93. VOID ReplyPkt( struct DosPacket *dp, LONG res1, LONG res2 );
  94. VOID AbortPkt( struct MsgPort *port, struct DosPacket *pkt );
  95. /*    Record Locking */
  96. BOOL LockRecord( BPTR fh, ULONG offset, ULONG length, ULONG mode, ULONG timeout );
  97. BOOL LockRecords( struct RecordLock *recArray, ULONG timeout );
  98. BOOL UnLockRecord( BPTR fh, ULONG offset, ULONG length );
  99. BOOL UnLockRecords( struct RecordLock *recArray );
  100. /*    Buffered File I/O */
  101. BPTR SelectInput( BPTR fh );
  102. BPTR SelectOutput( BPTR fh );
  103. LONG FGetC( BPTR fh );
  104. LONG FPutC( BPTR fh, LONG ch );
  105. LONG UnGetC( BPTR fh, LONG character );
  106. LONG FRead( BPTR fh, APTR block, ULONG blocklen, ULONG number );
  107. LONG FWrite( BPTR fh, CONST APTR block, ULONG blocklen, ULONG number );
  108. STRPTR FGets( BPTR fh, STRPTR buf, ULONG buflen );
  109. LONG FPuts( BPTR fh, CONST_STRPTR str );
  110. VOID VFWritef( BPTR fh, CONST_STRPTR format, CONST LONG *argarray );
  111. VOID FWritef( BPTR fh, CONST_STRPTR format, ... );
  112. LONG VFPrintf( BPTR fh, CONST_STRPTR format, CONST APTR argarray );
  113. LONG FPrintf( BPTR fh, CONST_STRPTR format, ... );
  114. LONG Flush( BPTR fh );
  115. LONG SetVBuf( BPTR fh, STRPTR buff, LONG type, LONG size );
  116. /*    DOS Object Management */
  117. BPTR DupLockFromFH( BPTR fh );
  118. BPTR OpenFromLock( BPTR lock );
  119. BPTR ParentOfFH( BPTR fh );
  120. BOOL ExamineFH( BPTR fh, struct FileInfoBlock *fib );
  121. LONG SetFileDate( CONST_STRPTR name, CONST struct DateStamp *date );
  122. LONG NameFromLock( BPTR lock, STRPTR buffer, LONG len );
  123. LONG NameFromFH( BPTR fh, STRPTR buffer, LONG len );
  124. WORD SplitName( CONST_STRPTR name, ULONG separator, STRPTR buf, LONG oldpos, LONG size );
  125. LONG SameLock( BPTR lock1, BPTR lock2 );
  126. LONG SetMode( BPTR fh, LONG mode );
  127. LONG ExAll( BPTR lock, struct ExAllData *buffer, LONG size, LONG data, struct ExAllControl *control );
  128. LONG ReadLink( struct MsgPort *port, BPTR lock, CONST_STRPTR path, STRPTR buffer, ULONG size );
  129. LONG MakeLink( CONST_STRPTR name, LONG dest, LONG soft );
  130. LONG ChangeMode( LONG type, BPTR fh, LONG newmode );
  131. LONG SetFileSize( BPTR fh, LONG pos, LONG mode );
  132. /*    Error Handling */
  133. LONG SetIoErr( LONG result );
  134. BOOL Fault( LONG code, STRPTR header, STRPTR buffer, LONG len );
  135. BOOL PrintFault( LONG code, CONST_STRPTR header );
  136. LONG ErrorReport( LONG code, LONG type, ULONG arg1, struct MsgPort *device );
  137. /*    Process Management */
  138. struct CommandLineInterface *Cli( VOID );
  139. struct Process *CreateNewProc( CONST struct TagItem *tags );
  140. struct Process *CreateNewProcTagList( CONST struct TagItem *tags );
  141. struct Process *CreateNewProcTags( ULONG tag1type, ... );
  142. LONG RunCommand( BPTR seg, LONG stack, CONST_STRPTR paramptr, LONG paramlen );
  143. struct MsgPort *GetConsoleTask( VOID );
  144. struct MsgPort *SetConsoleTask( CONST struct MsgPort *task );
  145. struct MsgPort *GetFileSysTask( VOID );
  146. struct MsgPort *SetFileSysTask( CONST struct MsgPort *task );
  147. STRPTR GetArgStr( VOID );
  148. BOOL SetArgStr( CONST_STRPTR string );
  149. struct Process *FindCliProc( ULONG num );
  150. ULONG MaxCli( VOID );
  151. BOOL SetCurrentDirName( CONST_STRPTR name );
  152. BOOL GetCurrentDirName( STRPTR buf, LONG len );
  153. BOOL SetProgramName( CONST_STRPTR name );
  154. BOOL GetProgramName( STRPTR buf, LONG len );
  155. BOOL SetPrompt( CONST_STRPTR name );
  156. BOOL GetPrompt( STRPTR buf, LONG len );
  157. BPTR SetProgramDir( BPTR lock );
  158. BPTR GetProgramDir( VOID );
  159. /*    Device List Management */
  160. LONG SystemTagList( CONST_STRPTR command, CONST struct TagItem *tags );
  161. LONG System( CONST_STRPTR command, CONST struct TagItem *tags );
  162. LONG SystemTags( CONST_STRPTR command, ULONG tag1type, ... );
  163. LONG AssignLock( CONST_STRPTR name, BPTR lock );
  164. BOOL AssignLate( CONST_STRPTR name, CONST_STRPTR path );
  165. BOOL AssignPath( CONST_STRPTR name, CONST_STRPTR path );
  166. BOOL AssignAdd( CONST_STRPTR name, BPTR lock );
  167. LONG RemAssignList( CONST_STRPTR name, BPTR lock );
  168. struct DevProc *GetDeviceProc( CONST_STRPTR name, struct DevProc *dp );
  169. VOID FreeDeviceProc( struct DevProc *dp );
  170. struct DosList *LockDosList( ULONG flags );
  171. VOID UnLockDosList( ULONG flags );
  172. struct DosList *AttemptLockDosList( ULONG flags );
  173. BOOL RemDosEntry( struct DosList *dlist );
  174. LONG AddDosEntry( struct DosList *dlist );
  175. struct DosList *FindDosEntry( CONST struct DosList *dlist, CONST_STRPTR name, ULONG flags );
  176. struct DosList *NextDosEntry( CONST struct DosList *dlist, ULONG flags );
  177. struct DosList *MakeDosEntry( CONST_STRPTR name, LONG type );
  178. VOID FreeDosEntry( struct DosList *dlist );
  179. BOOL IsFileSystem( CONST_STRPTR name );
  180. /*    Handler Interface */
  181. BOOL Format( CONST_STRPTR filesystem, CONST_STRPTR volumename, ULONG dostype );
  182. LONG Relabel( CONST_STRPTR drive, CONST_STRPTR newname );
  183. LONG Inhibit( CONST_STRPTR name, LONG onoff );
  184. LONG AddBuffers( CONST_STRPTR name, LONG number );
  185. /*    Date, Time Routines */
  186. LONG CompareDates( CONST struct DateStamp *date1, CONST struct DateStamp *date2 );
  187. LONG DateToStr( struct DateTime *datetime );
  188. LONG StrToDate( struct DateTime *datetime );
  189. /*    Image Management */
  190. BPTR InternalLoadSeg( BPTR fh, BPTR table, CONST LONG *funcarray, LONG *stack );
  191. BOOL InternalUnLoadSeg( BPTR seglist, VOID (*CONST freefunc)() );
  192. BPTR NewLoadSeg( CONST_STRPTR file, CONST struct TagItem *tags );
  193. BPTR NewLoadSegTagList( CONST_STRPTR file, CONST struct TagItem *tags );
  194. BPTR NewLoadSegTags( CONST_STRPTR file, ULONG tag1type, ... );
  195. LONG AddSegment( CONST_STRPTR name, BPTR seg, LONG system );
  196. struct Segment *FindSegment( CONST_STRPTR name, CONST struct Segment *seg, LONG system );
  197. LONG RemSegment( struct Segment *seg );
  198. /*    Command Support */
  199. LONG CheckSignal( LONG mask );
  200. struct RDArgs *ReadArgs( CONST_STRPTR arg_template, LONG *array, struct RDArgs *args );
  201. LONG FindArg( CONST_STRPTR keyword, CONST_STRPTR arg_template );
  202. LONG ReadItem( CONST_STRPTR name, LONG maxchars, struct CSource *cSource );
  203. LONG StrToLong( CONST_STRPTR string, LONG *value );
  204. LONG MatchFirst( CONST_STRPTR pat, struct AnchorPath *anchor );
  205. LONG MatchNext( struct AnchorPath *anchor );
  206. VOID MatchEnd( struct AnchorPath *anchor );
  207. LONG ParsePattern( CONST_STRPTR pat, STRPTR buf, LONG buflen );
  208. BOOL MatchPattern( CONST_STRPTR pat, STRPTR str );
  209. VOID FreeArgs( struct RDArgs *args );
  210. STRPTR FilePart( CONST_STRPTR path );
  211. STRPTR PathPart( CONST_STRPTR path );
  212. BOOL AddPart( STRPTR dirname, CONST_STRPTR filename, ULONG size );
  213. /*    Notification */
  214. BOOL StartNotify( struct NotifyRequest *notify );
  215. VOID EndNotify( struct NotifyRequest *notify );
  216. /*    Environment Variable functions */
  217. BOOL SetVar( CONST_STRPTR name, CONST_STRPTR buffer, LONG size, LONG flags );
  218. LONG GetVar( CONST_STRPTR name, STRPTR buffer, LONG size, LONG flags );
  219. LONG DeleteVar( CONST_STRPTR name, ULONG flags );
  220. struct LocalVar *FindVar( CONST_STRPTR name, ULONG type );
  221. LONG CliInitNewcli( struct DosPacket *dp );
  222. LONG CliInitRun( struct DosPacket *dp );
  223. LONG WriteChars( CONST_STRPTR buf, ULONG buflen );
  224. LONG PutStr( CONST_STRPTR str );
  225. LONG VPrintf( CONST_STRPTR format, CONST APTR argarray );
  226. LONG Printf( CONST_STRPTR format, ... );
  227. /* these were unimplemented until dos 36.147 */
  228. LONG ParsePatternNoCase( CONST_STRPTR pat, UBYTE *buf, LONG buflen );
  229. BOOL MatchPatternNoCase( CONST_STRPTR pat, STRPTR str );
  230. /* this was added for V37 dos, returned 0 before then. */
  231. BOOL SameDevice( BPTR lock1, BPTR lock2 );
  232.  
  233. /* NOTE: the following entries did NOT exist before ks 36.303 (2.02) */
  234. /* If you are going to use them, open dos.library with version 37 */
  235.  
  236. /* These calls were added for V39 dos: */
  237. VOID ExAllEnd( BPTR lock, struct ExAllData *buffer, LONG size, LONG data, struct ExAllControl *control );
  238. BOOL SetOwner( CONST_STRPTR name, LONG owner_info );
  239.  
  240. #ifdef __cplusplus
  241. }
  242. #endif /* __cplusplus */
  243.  
  244. #endif   /* CLIB_DOS_PROTOS_H */
  245.